home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue53 / DataMod / MDIExample1 / MDIExample1U2.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-11-24  |  923 b   |  47 lines

  1. unit MDIExample1U2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Grids, DBGrids, Db, MDIExample1DM;
  8.  
  9. type
  10.   TForm2 = class(TForm)
  11.     DataSource1: TDataSource;
  12.     DBGrid1: TDBGrid;
  13.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  14.     procedure FormCreate(Sender: TObject);
  15.     procedure FormShow(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.     DataModule: TDataModule1;
  21.   end;
  22.  
  23. var
  24.   Form2: TForm2;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
  31. begin
  32.   Action:=caFree;
  33. end;
  34.  
  35. procedure TForm2.FormCreate(Sender: TObject);
  36. begin
  37.   DataModule:=TDataModule1.Create(self);
  38.   // DataSource1.DataSet:=DataModule.Table1;
  39. end;
  40.  
  41. procedure TForm2.FormShow(Sender: TObject);
  42. begin
  43.   DataModule.Name:='';
  44. end;
  45.  
  46. end.
  47.